package com.sx.entity.basic;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.sx.basic.BasicEntity;
import com.sx.basic.serializer.LongToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;

/**
 * @author AdinZ
 * @date 2020/11/12 11:50
 * 文章内容
 */
@Data
@NoArgsConstructor
@TableName(value = "sx_article")
@Entity
@Table(name = "sx_article")
@ApiModel(description = "文章表")
public class ArticleEntity extends BasicEntity {
    @Id
    @GeneratedValue
    @TableId(type = IdType.ASSIGN_ID)
    @JSONField(serializeUsing = LongToStringSerializer.class)
    private Long id;
    @ApiModelProperty("分类id")
    @JSONField(serializeUsing = LongToStringSerializer.class)
    private long cid;
    @ApiModelProperty("文章标题")
    private String title;
    @ApiModelProperty("文章内容")
    @Column(columnDefinition = "text")
    private String body;
    @ApiModelProperty("文章添加时间")
    private long created=System.currentTimeMillis();
    @ApiModelProperty("排序")
    private int sort;


}
